#include "MyPool.h"

typedef struct { 
    void                *data;
    char				*buf;
    int					num;
} nlu_connection_t;

int main()
{
	CMyPool my;
	nlu_connection_t *c;
	size_t size = 100*1024;//(100kb)
	nlu_pool_t *pool;
	
	pool = my.create_pool(size);		
	
	c = (nlu_connection_t *)my.nlu_pcalloc(pool, sizeof(nlu_connection_t));
	
	c->num = 8;
	c->buf = (char*)my.nlu_pcalloc(pool, 100);
	strncpy(c->buf, "hi! everyone is OK? ", 100);
	
	std::cout<<"num:"<<c->num<<std::endl;
	std::cout<<"buf:"<<c->buf<<std::endl;
	
	my.destory_pool(pool);
	return 0;
}